<template>
  <div>
      <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="80px">
        <el-form-item label="学院" prop="field101">
          <el-input v-model="formData.field101" disabled placeholder="请输入学院" readonly :style="{width: '100%'}">
          </el-input>
        </el-form-item>
        <el-form-item label="专业" prop="field102">
          <el-input v-model="formData.field102" disabled placeholder="请输入专业" readonly :style="{width: '100%'}">
          </el-input>
        </el-form-item>
        <el-form-item label="课程" prop="field103">
          <el-input v-model="formData.field103" disabled placeholder="请输入课程" readonly clearable
            :style="{width: '100%'}"></el-input>
        </el-form-item>
        <el-form-item label="章节序号" prop="field104">
          <el-input v-model="formData.field104" placeholder="请输入章节序号" clearable :style="{width: '100%'}">
          </el-input>
        </el-form-item>
        <el-form-item label="章节名称" prop="field105">
          <el-input v-model="formData.field105" placeholder="请输入章节名称" clearable :style="{width: '100%'}">
          </el-input>
        </el-form-item>
      </el-form>
  </div>
</template>
<script>
export default {
  name: "change",
  props: ["row"],
  data() {
    return {
      formData: {
        field101: undefined,
        field102: undefined,
        field103: undefined,
        field104: undefined,
        field105: undefined,
      },
      rules: {
        field101: [{
          required: true,
          message: '请输入学院',
          trigger: 'blur'
        }],
        field102: [{
          required: true,
          message: '请输入专业',
          trigger: 'blur'
        }],
        field103: [{
          required: true,
          message: '请输入课程',
          trigger: 'blur'
        }],
        field104: [{
          required: true,
          message: '请输入序号',
          trigger: 'blur'
        }],
        field105: [{
          required: true,
          message: '请输入名称',
          trigger: 'blur'
        }],
      },
    }
  },
  computed: {},
  watch: {},
  created() {
      console.log("父组件传值",this.row)
      this.formData=this.row
  },
  mounted() {},
  methods: {
    handelConfirm() {
        console.log(
            this.formData
        )
      this.$refs['elForm'].validate(valid => {
        if (!valid) return
        this.close()
      })
    },
  }
}

</script>
<style>
</style>
